<template>
	<div class="carry" :style="{height: carryHeight + 'px'}">
        <div class="cellBox">
        	<mt-cell title="红包收入" class="bgnone"><span>{{userInfo.income_red}}</span><img slot="icon" src="../assets/img/redPocIcon.png"></mt-cell>
        	<mt-cell title="奖励收入" class="bgnone"><span>{{userInfo.income_generalize}}</span><img slot="icon" src="../assets/img/jiangliIcon.png"></mt-cell>
        	<mt-cell title="我的余额" class="bgnone" to="/page14"><span class="noBg">{{userInfo.sum
        	}}</span><img slot="icon" src="../assets/img/yueIcon.png"></mt-cell>
        	<mt-cell title="我的兑换" class="bgnone" to="/page10"><span>兑换</span><img slot="icon" src="../assets/img/duihuanIcon.png"></mt-cell>
        	<mt-cell title="我的充值" class="bgnone" to="/page10"><span>充值</span><img slot="icon" src="../assets/img/chongzhiIcon.png"></mt-cell>
        	<mt-cell title="代理详情" class="bgnone" to="/page15"><img slot="icon" src="../assets/img/dailiIcon.png"></mt-cell>
        </div>
		<bottom-nav act="selfCenter"></bottom-nav>
	</div>
</template>

<script>
	import bottomNav from './bottomNav'
	export default {
		name: 'carry',
		data () {
			return {
                carryHeight: 0,
                userInfo:{}
			}
		},
		components: {bottomNav},
		mounted () {
			this.userInfo = JSON.parse(window.localStorage.getItem("userInfo"));
			console.log(this.userInfo)
			let openid =  this.userInfo.openid;
			let that = this;	
  	        this.axios({
				method:"get",
				url: "http://xyydj.daoapp.io/mobile/member?openid=" + openid,
			}).then(function(res){
				that.userInfo = res.data.data;
				console.log(that.userInfo)
			})
			let cellWrapper = document.querySelectorAll('.mint-cell-wrapper');
			for(let i = 0; i <cellWrapper.length; i++) {
				cellWrapper[i].style.background = 'none';
			}
		},
		created() {
            this.init();
		},
		methods: {
			init () {
				this.carryHeight = (document.documentElement.clientHeight - document.documentElement.clientHeight/750*4.9*10);			
			},
			openDialog() {
				MessageBox({
					message: '<p>拆红包</p>',
					title: '',
					dialogClass: 'carry1Dialog',
					showCancelButton: true,
					confirmButtonText: '',
					cancelButtonText: ''
				});
			}
		}
	}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.carry{padding-top: 19rem;background: url(../assets/img/bg3Top.png) top center no-repeat, url(../assets/img/bg1Bottom.jpg) bottom center no-repeat;background-size: 100% auto;width: 100%;box-sizing: border-box;}
.cellBox{margin: 0 auto;padding: 0 1.5rem;width: 34.3rem;background: #fff;border-radius: 8px;overflow: hidden;box-sizing: border-box;}
.cellBox img{margin-right: .5rem;width: 2.7rem;height: 2.7rem;}
.cellBox .mint-cell{height: 5.5rem;line-height: 5.5rem;font-size: 1.5rem;color: #000;border-bottom: 1px solid #f2b361;}
.cellBox .mint-cell:last-child{border-bottom: none;background: none;}
.cellBox span{position: relative;padding-right: 1rem;font-size: 1.5rem;color: #eb2626;height: 5.5rem;line-height: 5.5rem;}
/*.cellBox span:after{content: "";position: absolute;right: -.5rem;top: 2rem;background: url(../assets/img/formArrow.png) 0 0 no-repeat;width: .8rem;height: 1.4rem;background-size: .8rem auto;}*/
/*.cellBox span.noBg:after{background: none;}*/
.bgnone .mint-cell-wrapper{background-image: none;}
.cellBox .mint-cell .mint-cell-allow-right:after{background: url(../assets/img/formArrow.png) 0 0 no-repeat;background-size: .8rem;width: .8rem;height: 1.4rem;}
</style>
